<template>
  <div>
    <TypeNav></TypeNav>
    <ListContainer></ListContainer>
    <Recommend></Recommend>
    <Brand></Brand>
    <Rank></Rank>
    <Like></Like>
    <Floor v-for="(floor) in floorList" :key="floor.id" :floor="floor"></Floor>
    <Brand></Brand>
  </div>
</template>

<script>
import ListContainer from './listContainer';
import Brand from './brand';
import Recommend from './recommend';
import Rank from './rank';
import Like from './like';
import Floor from './floor';
import { mapState } from "vuex";


export default {
  name: "Home",
  components: {
    ListContainer,
    Recommend,
    Rank,
    Like,
    Floor,
    Brand
},
mounted() {
  // 挂载成功后发送一次请求
  this.$store.dispatch("getFloorList"); 
},
computed: {
    ...mapState({
      floorList: (state) => state.home.floorList,
    }),
  },
}
</script>
<style scoped>
</style>
